import request from '@/utils/request'
import qs from 'qs';
// 查询单条接收
export const Get = params => request('/api/v1/SampleReceiving/Get', { params: params });

export function create(data) {
  return request({
    url: '/api/v1/SampleReceiving/Create',
    method: 'post',
    data
  })
}
export function creates(data) {
  return request({
    url: '/api/v1/SampleReceiving/Creates',
    method: 'post',
    data
  })
}

export function deleteRecord(data) {
  return request({
    url: '/api/v1/SampleReceiving/Delete',
    method: 'delete',
    data
  })
}

export function update(data) {
  return request({
    url: '/api/v1/SampleReceiving/Update',
    method: 'post',
    data
  })
}

export function getList(data, pagination) {
  if (pagination) {
    data["pageIndex"] = pagination.pageIndex;
    data["pageSize"] = pagination.pageSize;
  }
  return request({
    url: '/api/v1/SampleReceiving/GetList',
    method: 'get',
    params: data
  })
}

export function SampleReceivingPendingGetList(data, pagination) {
  if (pagination) {
    data["pageIndex"] = pagination.pageIndex;
    data["pageSize"] = pagination.pageSize;
  }
  return request({
    url: '/api/v1/SampleReceiving/SampleReceivingPendingGetList',
    method: 'get',
    params: data
  })
}

export function exportData(data) {
  return request({
    url: '/api/v1/SampleReceiving/ExportData',
    method: 'post',
    params: data,
    paramsSerializer: (params) => qs.stringify(params, { indices: false }),
    responseType: 'blob'
  })
}
